{% extends 'basepl.html' %}
{% block head %}
{% load static %}
<title>{{ cname }}</title>
    <style>
    .page{
        width: 500px;
        height: 30px;
        bottom: 0;
        position: absolute;
    }
    .page>a{
        padding-left: 10px;
        margin-left: 10px;
    }
    #resource{
       background-color: ghostwhite;
        border: rgba(56, 25, 169, 0.07) solid ;
        width: 560px;
        height: 590px;
        left: 530px;
        top:0;
        position: absolute;

    }
    #re{

        padding-right:10px;
        overflow-y:auto;
        padding-left:10px;
        SCROLLBAR-FACE-COLOR:#ffffff;
        font-size:13pt;
        padding-bottom:0;
        scrollbar-highlight-color:#ffffff;
        scrollbar-shadow-color:#919192;
        color:blue;
        scrollbar-3dlight-color:#ffffff;
        line-height:100%;
        scrollbar-arrow-color:#919192;
        padding-top:0;
        scrollbar-track-color:#ffffff;
        font-family: 宋体;
        scrollbar-darkshadow-color:#ffffff;
        letter-spacing:1pt;
        position: absolute;
        top: 64px;
        width: 530px;
        height: 515px;
    }
    #sqd{
        position: absolute;
        top: 20px;
        right: 80px;
    }
    #sqd>input{
        color: #b113e2;

    }
    td>a{
        text-decoration: none;
        font-size: 20px;
        font-family: "Microsoft Himalaya";

    }


    </style>


{% endblock head%}
{% block nav %}
<li><a href="/stuIndex">首页</a></li>
<li><a href="#top">大学课程教学过程管理系统</a></li>
<li><a href="/">切换账号</a></li>
<li><a href="/stuIndex/stuTask?cname={{ request.session.cname }}">&#9658;{{ request.session.cname }}&#9668;</a></li>
<li><a href="#">关于</a></li>
<li><a href="/">注销</a></li>
{% endblock nav %}
{% block li %}
    <li><a href="/stuIndex/stuTask/zuoyetj">作&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;业</a></li>
    <li><a href="#">讨&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;论</a></li>
    <li><a href="#">资&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;源</a></li>
{% endblock li %}
{% block section %}
<div id="ly">
    <div id="comment">
        <h3 align="center">讨论</h3>
        <form  method="POST" enctype="multipart/form-data">
            {% csrf_token %}
            <table class="table table-striped table-bordered table-hover table-condensed">
                <label>标&nbsp;&nbsp;&nbsp;题:</label> <input type="text" name="title" placeholder="必填" required/>
               <br><label>内&nbsp;&nbsp;&nbsp;容:</label> <textarea name="content" cols="30" rows="4"></textarea>
            </table>
            <input class="btn btn-success" type="submit" value="发帖"/>
        </form>
    </div>
    <br>
    <hr>

    <div id="lyshow">
         <table cellpadding="8px"  >
            <tr>
                <td width="250">话  题</td>
                <td width="80">发布者</td>
                <td width="170">发布时间</td>
            </tr>
            {% for foo in p %}
                <tr>
                    <td width="250px">{{ forloop.counter }}&#10151;<a class="tp" href="/stuIndex/stuTask/ly?tid={{ foo.id }}" onmouseover="overShow(this,event)" onmouseout="outHide()">{{ foo.title }}</a></td>
                    <td width="80">{{ foo.snum }}</td>
                    <td width="170">{{ foo.lytime }}</td>
                </tr>
            {% endfor %}
        </table>

    </div>
     <div class="page">
    {% if p.has_previous %}
        <a href="/stuIndex/stuTask/{{ p.previous_page_number}}?cname={{ cname }}">上一页</a>
    {% endif %}
        {% for foo in pg.page_range %}
            {% if foo == p.number %}
                <a href="#">{{ foo }}</a>
                {% else %}
                <a href="/stuIndex/stuTask/{{ foo }}?cname={{ cname }}"
                >{{ foo }}</a>
            {% endif %}
        {% endfor %}
    {% if p.has_next %}
        <a href="/stuIndex/stuTask/{{ p.next_page_number }}?cname={{ cname }}">下一页</a>
    {% endif %}
    </div>
</div>
<div id="resource">
    <h3 id="ttt" align="center">资源</h3>
    <hr>
    <div id="re">

        <table cellpadding="10px" >
            {% for foo in source %}
                <tr>
                    <td width="320px">{{ forloop.counter }}&#10151;<a  class="relink" href="/download?name={{ foo.scfp }}">{{ foo.scfp }}</a></td>
                    <td width="230px">{{ foo.sctime }}</td>
                </tr>
            {% endfor %}
        </table>
    </div>

</div>

{% endblock section %}
{% block qd %}
    <div id="sqd">
        <input type="button" value="签到" onclick="qd()">
    </div>
    <script>
        function qd() {
            $.get('/qiandao_ajax' ,function (data) {
                alert(data.msg)
            })

        }
    </script>
{% endblock qd %}